﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Globalization;
using System.Web.Security;

namespace RIS.TMP.WEB.APP.Models
{
    [Table("MRSaveRestore")]
    public class MRSaveRestore
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int SResId { get; set; }
        [ForeignKey("MRestoreToRepair")]
        public Nullable<int> ReId { get; set; }
        [ForeignKey("MRestoreToAdmin")]
        public Nullable<int> ResId { get; set; }
        [Display(Name = "รายละเอียดในการสั่งซ่อม")]
        public string RemarkRestore { get; set; }
        [Display(Name = "เลขที่ใบสั่งซ่อม")]
        public string Invoine { get; set; }
        [Display(Name = "รายละเอียดของการซ่อมหรือเปลี่ยน")]
        public string ChangeRestore { get; set; }
        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        [DataType(DataType.Date)]
        [Display(Name = "วันที่เริ่มซ่อม")]
        public Nullable<System.DateTime> FirstSucdate { get; set; }
        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        [DataType(DataType.Time)]
        [Display(Name = "เวลาเริ่มซ่อม")]
        public Nullable<System.DateTime> FirstSucTime { get; set; }
        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        [DataType(DataType.Date)]
        [Display(Name = "วันที่ซ่อมเสร็จ")]
        public Nullable<System.DateTime> LastSucdate { get; set; }
        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        [DataType(DataType.Time)]
        [Display(Name = "เวลาที่ซ่อมเสร็จ")]
        public Nullable<System.DateTime> LastSucTime { get; set; }
        [Display(Name = "รวมจำนวนวันซ่อม")]
        public string DaySave { get; set; }
        [Display(Name = "รวมจำนวนชั่วโมงซ่อม")]
        public string HourSave { get; set; }
        [Display(Name = "ค่าเรื่องในการซ่อม")]
        public string PriceRestorespares { get; set; }
        [Display(Name = "ค่าอะไหล่ในการซ่อม")]
        public string PriceRestoreH { get; set; }
        [Display(Name = "รวมค่าใช้จ่ายในการซ่อม")]
        public string PriceRestoreAll { get; set; }
        [ForeignKey("MRPoint")]
        public Nullable<int> MRPId { get; set; }
        [Display(Name = "ปิดงานซ่อม")]
        public Nullable<int> CloseId { get; set; }
        public string Remarks { get; set; }
        public string RecordStatus { get; set; }
        public string CreateBy { get; set; }
        public Nullable<System.DateTime> CreateWhen { get; set; }
        public string UpdateBy { get; set; }
        public Nullable<System.DateTime> UpdateWhen { get; set; }

        public virtual MRPoint MRPoint { get; set; }
        public virtual MRestoreToRepair MRestoreToRepair { get; set; }
        public virtual MRestoreToAdmin MRestoreToAdmin { get; set; }
    }
}